﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />
<!-- jsp文件头和头部 -->
<%@ include file="../index/top.jsp"%>
<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />
</head>
<body class="no-skin">

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
						
						<!-- 检索  -->
						<form action="period/list.do" method="post" name="goodsForm" id="goodsForm">
						<%-- <input type="hidden" name="classIds" id="classIds" value="${classIds}"/> --%>
						<table style="margin-top:5px;">
							<tr>
								<td>
									<div class="nav-search">
									<span class="input-icon">
										<input class="nav-search-input" id="title" type="text" name="title" value="${pd.title}" placeholder="这里输入商品名称或期次号" style="vertical-align:top;width: 190px;"/>
										<i class="ace-icon fa fa-search nav-search-icon"></i>
									</span>
									</div>
								</td>
								<td style="vertical-align:top;padding-left:2px;">
								 	<select class="chosen-select form-control" name="state" id="state" data-placeholder="状态" style="vertical-align:top;width: 120px;">
									<option value="">全部</option>
									<option value="01" <c:if test="${pd.state=='01'}">selected</c:if>>上架</option>
									<option value="00" <c:if test="${pd.state=='00'}">selected</c:if>>下架</option>
								  	</select>
								</td>
                                <td style="vertical-align:top;padding-left:2px;">
                                    <select class="chosen-select form-control"  name="base_id" id="base_id" data-placeholder="选择基地"
                                    style="vertical-align:top;width: 120px;">
                                    <option value="">全部</option>
                                      <c:forEach var="co" varStatus="i" items="${baseList}">
                                        <option value="${co.id }" <c:if test='${pd.base_id == co.id}'>selected=selected</c:if>>${co.name}</option>
                                      </c:forEach>
                                  </select>
                                  <!--  -->
                                  </td>
								<c:if test="${QX.cha == 1 }">
								<td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="searchs();"  title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
								</c:if>
								<%-- <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if> --%>
							</tr>
						</table>
						<!-- 检索  -->
					
						     <table id="simple-table" class="table table-striped table-bordered table-hover"  style="margin-top:5px;">
							  <thead>
							  
								<tr>
								  <th class="center" style="width:35px;">
									<label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
									</th>
									<th class="center" style="width:50px;">排序</th>
									<th class="center">期次ID</th>
                                    <th class="center">期次号</th>
									<th class="center">商品标题</th>
									<th class="center">零售价</th>
                                    <th class="center">所在基地</th>
                                    <th class="center">上架时间</th>
                                    <th class="center">下架时间</th>
                                    <th class="center">销售状态</th>
                                    <th class="center">状态</th>
									<th class="center">操作</th>
								</tr>
							</thead>
													
							<tbody id="goodlist">
								
							<!-- 开始循环 -->	
							<c:choose>
								<c:when test="${not empty periodList}">
									<c:if test="${QX.cha == 1 }">
									<c:forEach items="${periodList}" var="pl" varStatus="vs">
												
										<tr>
										 <td class='center' style="width: 30px;">
												<label><input type='checkbox' name='ids' value="${pl.id }" id="${pl.state }"  class="ace"/><span class="lbl"></span></label>
											</td>
											<td class='center' style="width: 30px;">${vs.index+1}</td>
											<td class="center">${pl.id }</td>
                                            <td class="center">${pl.time }</td>
                                            <c:if test="${pl.title == null}">
											 <td class="center">${pl.titles }</td>
                                            </c:if>
                                            <c:if test="${pl.title != null}">
                                               <td class="center">${pl.title }</td>
                                            </c:if>
										    <td class="center">${pl.price }</td>
                                            <td class="center">${pl.name }</td>
                                            <td class="center">${pl.start_time }</td>
                                            <td class="center">${pl.end_time }</td>
                                            <td class="center"><c:if test="${pl.sale_type=='01'}">售卖中</c:if><c:if test="${pl.sale_type=='00'}">已售馨</c:if></td>
                                            <td class="center"><c:if test="${pl.state=='01'}">已上架</c:if><c:if test="${pl.state=='00'}">已下架</c:if></td>
											<td class="center">
											<%-- <c:if test="${QX.cha == 1 }">
												<a class="btn btn-xs btn-success" title="查看" onclick="editPeriod('${pl.id}','00');">
														<i class="ace-icon fa fa-eye" title="查看"></i>
													</a>
											</c:if> --%>
											<c:if test="${QX.edit == 1 }">
											 <c:if test="${pl.state=='00' }">	
													<a class="btn btn-xs btn-success" title="编辑" onclick="editPeriod('${pl.id}','${pl.goods_id}','${pl.base_id }');">
														<i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
													</a>
													<a class="btn btn-xs" title="上架" onclick="editGoodsState('${pl.id}','01','${pl.end_time }')" >
													<i class="ace-icon fa fa-lock bigger-120" title="上架"></i>
													</a>
                                                    <%-- <a class="btn btn-xs btn-success" title="设置绑定商品"
                                                      onclick="toGoodsSpecTime('${pl.id}');"> <i
                                                      class="ace-icon  fa fa-cog bigger-120"
                                                      title="设置绑定商品"></i>
                                                    </a> --%>
											  </c:if>
												<c:if test="${pl.state =='01' }">
													<a class="btn btn-xs btn-success" title="下架"
														onclick="editGoodsState('${pl.id}','00','${pl.end_time }')"> <i
														class="ace-icon fa fa-unlock bigger-120"
														title="下架"></i>
													</a>
                                                    <c:if test="${pl.sale_type =='01' }">
                                                      <a  class="btn btn-xs btn-success" href="javascript:;"
                                                        onclick="editSaleType('${pl.id}','00')"> 
                                                                                                                                                  售馨
                                                      </a>
                                                    </c:if>
                                                    <c:if test="${pl.sale_type =='00' }">
                                                      <a href="javascript:;" class="btn btn-xs btn-success"
                                                        onclick="editSaleType('${pl.id}','01')"> 
                                                                                                                                                 售卖                                                                                    
                                                      </a>
                                                    </c:if>
												</c:if>
												</c:if>
												 <%-- <c:if test="${QX.del == 1 && pl.state=='00'}">
													<a class="btn btn-xs btn-danger" onclick="delgood('${pl.id}');">
														<i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
													</a>
										         </c:if> --%>
											</td>
										</tr>
									
									</c:forEach>
									</c:if>
									<c:if test="${QX.cha == 0 }">
										<tr>
											<td colspan="15" class="center">您无权查看</td>
										</tr>
									</c:if>
								</c:when>
								<c:otherwise>
									<tr class="main_info">	
										<td colspan="15" class="center">没有相关数据</td>
									</tr>
								</c:otherwise>
							</c:choose>
							</tbody>
						</table>
						
					<div class="page-header position-relative">
					<table style="width:100%;">
						<tr>
								<td style="vertical-align:top;">
									<c:if test="${QX.add == 1 }">
									<a class="btn btn-mini btn-success" onclick="add();">新增</a>
									</c:if>
								</td>
								<c:if test="${QX.edit == 1 }">
								<td style="vertical-align:top;">
									<a class="btn btn-mini btn-success" onclick="batchUpState();">批量上架</a>
								</td>
								<td style="vertical-align:top;">
									<a class="btn btn-mini btn-success" onclick="batchDownState();">批量下架</a>
								</td>
								</c:if>
								<%-- <td style="vertical-align:top;">
								<c:if test="${QX.del == 1 }">
									<a title="批量删除" class="btn btn-mini btn-danger" onclick="delGoods();" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
									</c:if>
								</td> --%>
								<td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
							</tr>
					</table>
					</div>
					</form>
	
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->

		<!-- 返回顶部 -->
		<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
			<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
		</a>

	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<!-- 页面底部js¨ -->
	<%@ include file="../index/foot.jsp"%>
	<!-- 删除时确认窗口 -->
	<script src="static/ace/js/bootbox.js"></script>
	<!-- ace scripts -->
	<script src="static/ace/js/ace/ace.js"></script>
	<!-- 日期框 -->
	<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
	<!-- 下拉框 -->
	<script src="static/ace/js/chosen.jquery.js"></script>
	<!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	</body>

<script type="text/javascript">
$(top.hangge());
//检索
function searchs(){
	top.jzts();
	$("#goodsForm").submit();
}
//对接
function editDock(id){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="对接信息";
	 diag.URL = '<%=basePath%>goods/goDock.do?goods_id='+id;
	 diag.Width = 600;
	 diag.Height = 400;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();	
}


//新增
function add(){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="新增分期商品";
	 diag.URL = '<%=basePath%>period/goAddG.do';
	 diag.Width = 800;
	 diag.Height = 450;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			 if('${page.currentPage}' == '0'){
				 top.jzts();
				 setTimeout("self.location=self.location",100);
			 }else{
				 nextPage('${page.currentPage}');
			 }
		}
		diag.close();
	 };
	 diag.show();
}

  function toGoodsSpecTime(timeId){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="设置绑定商品";
	 diag.URL = '<%=basePath%>period/toGoodsSpecTime.do?timeId='+timeId;
	 diag.Width = 1000;
	 diag.Height = 400;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
  }

//查看
function seeGoodInfo(goods_id){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="查看";
	 diag.URL = '<%=basePath%>goods/goSee.do?id='+goods_id;
	 diag.Width = 1000;
	 diag.Height = 800;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
}

//修改
function editPeriod(timeId,goods_id,base_id){
	top.jzts();
  	 var diag = new top.Dialog();
  	 diag.Drag=true;
  	 diag.Title ="修改商品期次";
  	 diag.URL = '<%=basePath%>period/goodsGoodsTime.do?goods_id='+goods_id+'&base_id='+base_id+'&timeId='+timeId;
  	 diag.Width = 1200;
  	 diag.Height = 800;
  	 diag.CancelEvent = function(){ //关闭事件
  		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  			nextPage('${page.currentPage}');
  		}
  		diag.close();
  	 };
  	 diag.show();
  	 
	<%--  top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="修改商品期次";
	 diag.URL = '<%=basePath%>period/goEditG.do?timeId='+id;
	 diag.Width = 1200;
	 diag.Height = 900;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show(); --%>
}
//修改促销
function editGoodSale(id,discount,bidPrice,price){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="促销信息";
	 diag.URL = '<%=basePath%>goods/goSales.do?goods_id='+id+'&price='+price;
	 diag.Width = 800;
	 diag.Height = 400;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
		
}
//修改上下架状态
function editGoodsState(id,state,endTime){
	$.get("<%=basePath%>period/updateGoodsState.do",{
		         timeId:  id,
		        state:   state,
		        endTime: endTime,
		        },function(data){
		        //这里显示从服务器返回的数据
		       if("success"==data){
		    	   alert("修改成功");
		       }else if("failed"==data){
		    	   alert("修改失败");
		       }else if("timeEnd"==data){
		    	   alert("此商品下架时间已到!");
		       }else if("no-spec"==data){
		    	   alert("未找到商品!");
		       }else if("userTimeEnd"==data){
		    	   alert("此商品截止使用时间已到!");
		       }else if("no-stock"==data){
		    	   alert("期次库存到达上限!");
		       }else if("no-state"==data){
		    	   alert("区域商品未上架!");
		       }else if("no-goods"==data){
		    	   alert("本期次还未绑定区域商品!");
		       }
		        
		        nextPage('${page.currentPage}');
		    });	
}
		
		function editSaleType(id,state){
			$.get("<%=basePath%>period/updateSaleState.do",{
				         timeId:  id,
				        state:   state,
				        },function(data){
				        //这里显示从服务器返回的数据
				       if("success"==data){
				    	   alert("修改成功");
				       }else if("failed"==data){
				    	   alert("修改失败");
				       }
				        nextPage('${page.currentPage}');
				    });	
		}


//排序编辑
$(function () { 
	
	  var tdObj="";
	  var oldText="";
	  var inputObj="";
	  var newText="";
	  var id="";
	  if('${QX.edit}'==1){
    //给这些单元格注册鼠标点击事件  
    $("#goodlist tr").each(function() { 
        $(this).children('#seq').click(function(){
        	id=$(this).next().text();//获取下一个同级元素，即id
        	 //找到当前鼠标单击的td  
             tdObj = $(this); 
            //保存原来的文本  
             oldText = $(this).text();  
            //创建一个文本框  
            inputObj = $("<input type='text' value='" + oldText + "'/>");  
            //去掉文本框的边框  
            inputObj.css("border-width", 0);  
            inputObj.click(function () {  
                return false;  
            });  
            //使文本框的宽度和td的宽度相同  
            inputObj.width(tdObj.width());  
            inputObj.height(tdObj.height());  
            //去掉文本框的外边距  
            inputObj.css("margin", 0);  
            inputObj.css("padding", 0);  
            inputObj.css("text-align", "center");  
            inputObj.css("font-size", "16px");  
            inputObj.css("background-color", tdObj.css("background-color"));  
            //把文本框放到td中  
            tdObj.html(inputObj);  
            //文本框失去焦点的时候变为文本  
            inputObj.blur(function () {   
                newText = $(this).val(); 
                if(!isInt(newText)||newText.length>8){
                   alert("只能输入最多8位整数");
                   tdObj.html(oldText);
                }else{
                	 $.get("goods/updateSeq.do?id="+id+'&seq='+newText,function(data,status){
                		    if(data=="success"){
                		    	tdObj.html(newText);
                		    }
                		    else{
                		    	tdObj.html(oldText);
                		    }
                		  });
                }
                       
            }); 
        });  
    });   
	  }
   });  
//检查是否为正整数
function isInt(a)
{
    var reg = /^\d+$/; 
    return reg.test(a);
}

function toGoodsSpec(goodId){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="设置规格";
	 diag.URL = '<%=basePath%>goods/goodsSpecList.do?goodsId='+goodId;
	 diag.Width = 1600;
	 diag.Height = 700;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
}

		
function toGoodsUnit(goodsId){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="设置商品发货地";
	 diag.URL = '<%=basePath%>goods/goodsUnitList.do?goodsId='+goodsId;
	 diag.Width = 700;
	 diag.Height = 300;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
}

function toGoodsPrice(goodsId){
	 top.jzts();
	 var diag = new top.Dialog();
	 diag.Drag=true;
	 diag.Title ="设置批发价区间";
	 diag.URL = '<%=basePath%>goods/goodsPriceList.do?goodsId='+goodsId;
	 diag.Width = 800;
	 diag.Height = 400;
	 diag.CancelEvent = function(){ //关闭事件
		 if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
			nextPage('${page.currentPage}');
		}
		diag.close();
	 };
	 diag.show();
}
//复选框全选控制
var active_class = 'active';
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
	var th_checked = this.checked;//checkbox inside "TH" table header
	$(this).closest('table').find('tbody > tr').each(function(){
		var row = this;
		if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
		else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
	});
});
//批量上架
function batchUpState(){
			var str='';
			var state='';
			for(var i=0;i < document.getElementsByName('ids').length;i++)
			{
				  if(document.getElementsByName('ids')[i].checked){
					  if(document.getElementsByName('ids')[i].id !='00'){
							alert("存在已上架期次");
							return false;
						}
				  	if(str==''){
				  		str += document.getElementsByName('ids')[i].value;
				  	}else {
				  		str += ',' + document.getElementsByName('ids')[i].value;
				  	}
				  }
			} 
		 	if(str==''){
				alert("您没有选择任何商品");
				return false;
			}else{ 
					$.ajax({
						type: "POST",
						url: '<%=basePath%>period/updateBatchState.do?tm='+new Date().getTime(),
				    	data: {state:'01',ids:str},
						success: function(data){
						    if("success"==data){
							  alert("批量上架成功");
						   }else if("timeEnd"==data.substring(0,7)){
							   alert("id为(  "+data.substring(7,data.length)+"  )的期次下架时间已到，无法上架");
						   }else if("no-spec"==data.substring(0,7)){
							   alert("id为(  "+data.substring(7,data.length)+"  )的期次未找到商品，无法上架");
						   }else if("userTimeEnd"==data.substring(0,11)){
							   alert("id为(  "+data.substring(11,data.length)+"  )的期次截止使用时间已到，无法上架");
						   }else if("no-stock"==data.substring(0,8)){
							   alert("id为(  "+data.substring(8,data.length)+"  )的期次库存到达上限，无法上架");
						   }else if("no-state"==data.substring(0,8)){
							   alert("id为(  "+data.substring(8,data.length)+"  )的期次区域商品未上架，无法上架");
						   }else if("no-goods"==data.substring(0,8)){
							   alert("id为(  "+data.substring(8,data.length)+"  )的期次还未绑定区域商品，无法上架");
						   }else{
							   alert("批量上架失败");
						   }
							nextPage('${page.currentPage}');
						}
					});
				}
		}

//导出excel
function toExcel(){
	var keywords = $("#keywords").val();
	var code = $("#code").val();
	var state = $("#state").val();
	var stockState = $("#stockState").val();
	var startDiscount = $("#startDiscount").val();
	var endDiscount = $("#endDiscount").val();
	window.location.href='<%=basePath%>goods/excel.do?keywords='+keywords+'&code='+code+'&state='+state+'&stockState='+stockState+'&startDiscount='+startDiscount+'&endDiscount='+endDiscount;
}

//批量下架
function batchDownState(){
	var str='';
	var state='';
	for(var i=0;i < document.getElementsByName('ids').length;i++)
	{
		  if(document.getElementsByName('ids')[i].checked){
			  if(document.getElementsByName('ids')[i].id!='01'){
					alert("存在已下架期次");
					return false;
				}
		  	if(str=='') str += document.getElementsByName('ids')[i].value;
		  	else str += ',' + document.getElementsByName('ids')[i].value;
		  }
	} 
 	if(str==''){
		alert("您没有选择任何商品");
		return false;
	}else{ 
			$.ajax({
				type: "POST",
				url: '<%=basePath%>period/updateBatchState.do?tm='+new Date().getTime(),
		    	data: {state:'00',ids:str},
				success: function(data){
					if("success" == data){
						 alert("批量下架成功");
					}else{
						 alert("批量下架失败");
					}
					nextPage('${page.currentPage}');
					 
				}
			});
		}
}
//删除
function delgood(id){
	bootbox.confirm("确定要删除吗?", function(result) {
		if(result) {
			top.jzts();
			var url = "<%=basePath%>goods/delGood.do?id="+id;
			$.get(url,function(data){
				if(data=="success"){
					alert("删除成功");
				}
				else{
					alert("删除失败");
				}
				nextPage('${page.currentPage}');
			});
		};
	});
}
//批量删除
function delGoods(){
			var str='';
			var state='';
			for(var i=0;i < document.getElementsByName('ids').length;i++)
			{
				  if(document.getElementsByName('ids')[i].checked){
					  if(document.getElementsByName('ids')[i].id!='00'){
							alert("存在已上架商品,请先下架再删除");
							return false;
						}
				  	if(str=='') str += document.getElementsByName('ids')[i].value;
				  	else str += ',' + document.getElementsByName('ids')[i].value;
				  }
			} 
		 	if(str==''){
				alert("您没有选择任何商品");
				return false;
			}else{ 
					$.ajax({
						type: "POST",
						url: '<%=basePath%>goods/delGoods.do?tm='+new Date().getTime(),
				    	data: {ids:str},
						success: function(data){
							if(data=="success"){
								alert("批量删除成功");
							}
							else{
								alert("批量删除失败");
							}
							nextPage('${page.currentPage}'); 
						}
					});
				}
		}

</script>
</html>
